package com.ht.medicaltreatment.view

import android.content.Context
import com.blankj.utilcode.util.ToastUtils
import com.ht.medicaltreatment.R
import kotlinx.android.synthetic.main.dialog_blood_remark_layout.*

class BloodRemarkDialog(context: Context) : BaseDialog(context) {
    override fun getLayoutRes() = R.layout.dialog_blood_remark_layout

    fun show(remark: String,onString:(String)->Unit) {
        tvHistory.text = "历史备注：$remark"
        super.show()
        tvSubmit.setOnClickListener {
            if(etContent.text.isEmpty()){
                ToastUtils.showShort("请填写备注信息")
                return@setOnClickListener
            }
            onString(etContent.text.toString())
            dismiss()
        }
        tvCancel.setOnClickListener { dismiss() }
    }
}